#pragma once

#include "EventSocket.h"
#include "socks5.h"

class CProxySocket : public CEventSocket
{
public:
	CProxySocket(void);
public:
	~CProxySocket(void);
public:
	bool SetProxy( const char * server, unsigned short port, const char * user = "", const char * pass = "", unsigned char ver = PROXY_SOCKVER5 );
	bool SetProxy( std::string server, unsigned short port, std::string user, std::string pass, unsigned char ver = PROXY_SOCKVER5 );

	bool IsProxyConnection();
	bool IsUseProxy();
protected:
	//proxy varis
	bool           m_bConnection;
	bool           m_bUseProxy;
	unsigned char  m_ProxyVersion;
	unsigned short m_ProxyPort;
	std::string    m_ProxyServer;

	std::string    m_ProxyUser;
	std::string    m_ProxyPass;

	int            m_nLastError;
};
